<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            padding: 0px;
            margin: 0px;
        }
        .bigBox {
            height: 500px;
            width: 500px;
            padding: 20px 40px;
            border: 5px solid salmon;
            margin: 30px auto;
        }
        .smallBox {
            height: 100px;
            width: 100px;
            padding: 10px 20px;
            border: 5px solid rgb(155, 250, 114);
        }
    </style>
</head>
<body>
    <div class="bigBox">
        <div class="smallBox"></div>
    </div>

    <script>
        const bigBox = document.querySelector(".bigBox")
        const smallBox = document.querySelector(".smallBox")

        let bigCW = bigBox.clientWidth;
        let bigCH = bigBox.clientHeight;
        let smallCW = smallBox.clientWidth;
        let smallCH = smallBox.clientHeight;
        console.log("bigCW：",bigCW)
        console.log("bigCH：",bigCH)
        console.log("smallCW：",smallCW)
        console.log("smallCH：",smallCH)


        let bigOW = bigBox.offsetWidth;
        let bigOH = bigBox.offsetHeight;
        let smallOW = smallBox.offsetWidth;
        let smallOH = smallBox.offsetHeight;
        console.log("bigOW：",bigOW)
        console.log("bigOH：",bigOH)
        console.log("smallOW：",smallOW)
        console.log("smallOH：",smallOH)
    </script>
</body>
</html>